#include <iostream>
#include <cstring>
#include <queue>
using namespace std;

void solve(int n)
{
	queue<int> q;
	
	for(int i=1;i<=n;i++)
	{
		q.push(i);
	}
	while(q.size()>1)
	{
		for(int i=0;i<2;i++)
		{
			q.push(q.front());
			q.pop();
		}
		cout<<q.front()<<endl;
		q.pop();
	}
	cout<<q.front()<<endl;
}

int main() {
    int n;
    cin>>n;
    solve(n);
    return 0;
}
